package com.t216.dm216.controller;

import com.t216.dm216.common.Result;
import com.t216.dm216.pojo.DmOrder;
import com.t216.dm216.pojo.dto.DmOrderParamsDTO;
import com.t216.dm216.service.DmOrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order/api/v")
public class DmOrderApiViewController {

    @Resource
    private DmOrderService orderService;
//    @PostMapping("/createOrder")
    public Result createOrder(@RequestBody DmOrderParamsDTO orderParamsDTO){
        DmOrder order = orderService.addOrder(orderParamsDTO);
        return Result.success(order.getOrderNo());
    }
}
